package server
type request struct {
  a, b  int
  replyc chan int
}

type binOp func(a, b int) int

func run(op binOp, req *request) {
  reply := op(req.a, req.b)
  req.replyc <- reply
}


func server(op binOp, service chan *request) {
  for {
    req := <-service
    go run(op, req)
  }
}


func startServer(op binOp) chan *request {
  req := make(chan *request)
  go server(op, req)
  return req
}


